import 'package:amap_flutter_location/amap_location_option.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/location/controller.dart';
import 'package:industry_net/global/user/logic.dart';
import 'package:industry_net/pages/tab_controller/state.dart';

class TbController extends GetxController {
  final state = TabState();
  final userCtrl = Get.find<UserController>();
  final locationCtrl = Get.find<LocationController>();
  void clickTab(int index) {
    if (state.currentIndex.value == index) {
      return;
    }
    state.currentIndex.value = index;
    // state.pageController.jumpToPage(index);
  }

  @override
  void onInit() {
    super.onInit();
    locationCtrl.register();
    locationCtrl.location
        .setLocationOption(AMapLocationOption(onceLocation: true));
    locationCtrl.startLocation();
  }
}
